| Conditions | 2 |
| Total Lines | 24 |
| Code Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | /*eslint max-len: ["error", { "code": 150 }]*/ |
||
| 36 | getProfile() { |
||
| 37 | if (localStorage.getItem("activeUser")) { |
||
| 38 | let user = localStorage.getItem("activeUser"), |
||
| 39 | profile = []; |
||
| 40 | |||
| 41 | profile = JSON.parse(user); |
||
| 42 | this.setState({ |
||
| 43 | user: [ |
||
| 44 | <div key="profile"> |
||
| 45 | <h3 className="center">Username: {profile.name}</h3> |
||
| 46 | <h4 className="center">Birthday: {profile.birthday}</h4> |
||
| 47 | <h4 className="center">Country: {profile.country}</h4> |
||
| 48 | <h4 className="center">Email: {profile.email}</h4> |
||
| 49 | <p> |
||
| 50 | <button name="logoff" className="button center" onClick={this.logoff}>Logoff</button> |
||
| 51 | </p> |
||
| 52 | </div> |
||
| 53 | ], |
||
| 54 | username: profile.name |
||
| 55 | }); |
||
| 56 | } else { |
||
| 57 | this.setState({ |
||
| 58 | user: [ |
||
| 59 | <h3 key="registerfirst" className="center">Your profile will be shown below when you register</h3> |
||
| 60 | ] |
||
| 76 |